package com.manor.paradise.adapter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.manor.paradise.R
import com.manor.paradise.bean.OresBean

/**
 * 米粒明细
 * @constructor
 */
class OresAdapter(layoutResId: Int, data: MutableList<OresBean.RecordsBean>?) : BaseQuickAdapter<OresBean.RecordsBean, BaseViewHolder>
(layoutResId, data) {

    override fun convert(helper: BaseViewHolder, item: OresBean.RecordsBean) {
        var im_istop = helper.getView<ImageView>(R.id.im_istop)
        var tv_context = helper.getView<TextView>(R.id.tv_context)
        if(item.transType==1){
            im_istop.setImageResource(R.mipmap.pic_aura_list_top)
            tv_context.setText("+"+item.crystalOre.toString())

        }else{
            tv_context.setText("-"+item.crystalOre.toString())
            im_istop.setImageResource(R.mipmap.pic_aura_list_btn)
        }
        var tv_name = helper.getView<TextView>(R.id.tv_name)
        tv_name.setText(item.content)
        var tv_time = helper.getView<TextView>(R.id.tv_time)
        tv_time.setText(item.createTime.toString())
    }
}
